//
//  RW_FuncViewModel.m
//  SleepApp
//
//  Created by chuangqi on 2021/3/30.
//  Copyright © 2021 RiceWang. All rights reserved.
//

#import "RW_FuncViewModel.h"
#import "RW_FuncItemCollectionViewCell.h"

@implementation RW_FuncViewModel


#pragma mark -- 视图模型获取
/** 获取视图模型 */
-(void)getViewSuccess:(void(^)(NSArray<WLBaseCollectionViewLayerSection *> *response))success
                  fail:(void(^)(NSError *error))fail{
    if (success){
        success([self getFuncSection]);
    }
}


#pragma mark -- 视图模型生成
/** 生成登陆视图 */
-(NSArray<WLBaseCollectionViewLayerSection *> *)getFuncSection{
    NSMutableArray *array = [NSMutableArray array];
    
    WLBaseCollectionViewLayerSection *section = [[WLBaseCollectionViewLayerSection alloc]init];
    
    section.insetForSection = UIEdgeInsetsMake(1, 0, 1, 0);
    section.horizontalSection = 0;
    section.horizontalCount = 1;
    section.horizontalMaxWidth = Main_Screen_Width;
    section.verticalSection = 1;
    
    CGSize itemSize = [section getCellSizeHeight:45];
    {
        RW_FuncItemCollectionViewCellModel *model = [[RW_FuncItemCollectionViewCellModel alloc]init];
        model.players_Type = Players_Type_Player;
        model.title_string = @"默认播放器";
        model.icon_name = @"1234";
        [section.item addObject:[RW_FuncItemCollectionViewCell getRow:model
                                                             cellSize:itemSize]];
    }
//    {
//        RW_FuncItemCollectionViewCellModel *model = [[RW_FuncItemCollectionViewCellModel alloc]init];
//        model.players_Type = Players_Type_Mixed;
//        model.title_string = @"混声播放器";
//        model.icon_name = @"1234";
//        [section.item addObject:[RW_FuncItemCollectionViewCell getRow:model
//                                                             cellSize:itemSize]];
//    }
    [array addObject:section];
    
    return array;
}
@end
